package com.javarush.test.level18.lesson03.task03;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String fileName = reader.readLine();
        FileInputStream inputStream = new FileInputStream(fileName);
        List<Integer> bytes = new ArrayList<Integer>();
        int[] a=new int[127];
        while (inputStream.available()>0)
        {
            int b=inputStream.read();
            a[b]=a[b]+1;
        }
        inputStream.close();
        int max=a[0];
        for (int i=0; i<a.length; i++)
        {
            if(a[i]>max)
            {
                max = a[i];
            }
        }

        for (int i=0; i<a.length; i++)
        {
            if(a[i]==max)
            {
                bytes.add(i);
            }
        }

        for (int i=0; i<bytes.size(); i++)
        {
            if (i!=bytes.size()-1)
                System.out.print(bytes.get(i)+" ");
            else System.out.print(bytes.get(i));
        }


    }
}
